<template>
  <!-- 首页默认就一个RouterView组件 -->

  <ElConfigProvider :size="componentSizeStore.getCurrentSize" :locale="locale">
    <RouterView></RouterView>
  </ElConfigProvider>
</template>

<script setup lang="ts">
import { computed } from "vue";
import zhCn from "element-plus/dist/locale/zh-cn.mjs";
import en from "element-plus/dist/locale/en.mjs";
import { useComponentSizeStore } from "@/stores/componentSizeStore";
import { useLanguageStore } from "@/stores/languageStore";
import { useGenerateThem } from "@/hooks/useGenerateTheme";

const componentSizeStore = useComponentSizeStore();
const languageStore = useLanguageStore();

const locale = computed(() =>
  languageStore.languageState.lanuage === "zh-cn" ? zhCn : en
);

useGenerateThem(); // watch主题变化

// const toggle = () => {
//   const _language = languageStore.getLanuage === "zh-cn" ? "en" : "zh-cn";
//   languageStore.setLanuage(_language);
// };
</script>

<style scoped></style>
